package com.whq;

import com.whq.beans.*;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {


    public static void main(String[] args) {
//        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("spring-config.xml");
//        User user = (User)context.getBean("user");
//        User user = (User)beanFactory.getBean("user");
////        User user = context.getBean("user",User.class);
//        String str = (String)beanFactory.getBean("sayHi");
////        User user1 = (User)beanFactory.getBean("us1");
////        System.out.println(user1.getSex());
//        System.out.println(str);
//
//        Users users = beanFactory.getBean(Users.class);
//        User user2 = users.getUser();
//        System.out.println(user2.getName());

//        UserController userController = (UserController) beanFactory.getBean("userController");
//        System.out.println(userController.getUser().getName());

        Test1 beanUserController1 = beanFactory.getBean("test1",Test1.class);
//        BeanUserController2 beanUserController2 = beanFactory.getBean("beanUserController2",BeanUserController2.class);
    }
}
